// components/OldMan/man.js
const App = getApp();
Component({
    /**
     * 组件的属性列表
     */
    properties: {
        man: {
            type: Object,
            value: {
                headImage: '',
                age: 0,
                status: true,
                name: 'example',
                sex: 1,
                community: {
                    name: ''
                },
                uid: 0
            }
        }
    },

    /**
     * 组件的初始数据
     */
    data: {
        defaultHead: '/images/man_default.png',
        maleImg: '/images/male.png',
        femaleImg: '/images/female.png',
        statusImg: '/images/status.png',
        urlHome: App.path.ManHome,
        urlVisit: App.path.Visit
    },

    /**
     * 组件的方法列表
     */
    methods: {
        _visit(e) {
            App.addVisit(this.data.man.uid)
            // wx.navigateTo({
            //     url: this.data.urlVisit + '?uid=' + this.data.man.uid 
            // })
        },
        _showDetail(e) {
            // 只阻止点击冒泡事件
            // let { key } = e.currentTarget.dataset;
            // console.log(`show detail key is ${key}`)
            wx.showLoading({
                title: '',
                mask: true
            })
        }
    }
})
